package com.market.order.server.service.impl;

import java.util.List;

import com.market.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.market.order.server.mapper.TOrderDetailMapper;
import com.market.order.common.domain.TOrderDetail;
import com.market.order.server.service.ITOrderDetailService;

/**
 * 订单明细表Service业务层处理
 *
 * @author market
 * @date 2024-02-26
 */
@Service
public class TOrderDetailServiceImpl implements ITOrderDetailService
{
    @Autowired
    private TOrderDetailMapper tOrderDetailMapper;

    /**
     * 查询订单明细表
     *
     * @param id 订单明细表主键
     * @return 订单明细表
     */
    @Override
    public TOrderDetail selectTOrderDetailById(Integer id)
    {
        return tOrderDetailMapper.selectTOrderDetailById(id);
    }

    /**
     * 查询订单明细表列表
     *
     * @param tOrderDetail 订单明细表
     * @return 订单明细表
     */
    @Override
    public List<TOrderDetail> selectTOrderDetailList(TOrderDetail tOrderDetail)
    {
        return tOrderDetailMapper.selectTOrderDetailList(tOrderDetail);
    }

    /**
     * 新增订单明细表
     *
     * @param tOrderDetail 订单明细表
     * @return 结果
     */
    @Override
    public int insertTOrderDetail(TOrderDetail tOrderDetail)
    {
        return tOrderDetailMapper.insertTOrderDetail(tOrderDetail);
    }

    /**
     * 修改订单明细表
     *
     * @param tOrderDetail 订单明细表
     * @return 结果
     */
    @Override
    public int updateTOrderDetail(TOrderDetail tOrderDetail)
    {
        return tOrderDetailMapper.updateTOrderDetail(tOrderDetail);
    }

    /**
     * 批量删除订单明细表
     *
     * @param ids 需要删除的订单明细表主键
     * @return 结果
     */
    @Override
    public int deleteTOrderDetailByIds(Integer[] ids)
    {
        return tOrderDetailMapper.deleteTOrderDetailByIds(ids);
    }

    /**
     * 删除订单明细表信息
     *
     * @param id 订单明细表主键
     * @return 结果
     */
    @Override
    public int deleteTOrderDetailById(Integer id)
    {
        return tOrderDetailMapper.deleteTOrderDetailById(id);
    }

    @Override
    public List<TOrderDetail> selectOrderDetailList(Integer orderId) {

        return tOrderDetailMapper.selectOrderDetailList(orderId);
    }

    @Override
    public List<TOrderDetail> getDetailInfo(Integer orderId) {
        List<TOrderDetail> list=tOrderDetailMapper.getDetailInfo(orderId);
        return list;
    }

    @Override
    public Result<List<TOrderDetail>> findDetail(Integer orderId) {
        List<TOrderDetail> list=tOrderDetailMapper.findDetail(orderId);
        return Result.success(list);
    }

}
